// 创建新数组的方法
var moveZeroes = function (nums) {
  let curArr = [...nums];
  for (let i = 0; i < nums.length; i++) {
    if (nums[i] === 0) {
      curArr.splice(i, 1, "flag");
      curArr.push(0);
    }
  }
  let i = 0;
  curArr.forEach((item) => {
    if (item != "flag") {
      nums[i] = item;
      i++;
    }
  });
  console.log(nums);
};

// 双指针
var moveZeroes = function (nums) {
    let fast = 0;
    let slow = 0;
    for(let i=0;i<nums.length;i++) {
        
    }
};

moveZeroes([0, 1, 0, 3, 12]);
